package cn.chinaflame.pagodas.utils.excel;

import java.util.ArrayList;
import java.util.List;

import org.hellojavaer.poi.excel.utils.read.ExcelReadContext;
import org.hellojavaer.poi.excel.utils.read.ExcelReadException;
import org.hellojavaer.poi.excel.utils.read.ExcelReadSheetProcessor;

public class DefaultExcelReadSheetProcessor<T> extends ExcelReadSheetProcessor<T>{
	
	private List<T> dataList = new ArrayList<T>();
	
	public List<T> getDataList() {
		return dataList;
	}

	public void setDataList(List<T> dataList) {
		this.dataList = dataList;
	}

	@Override
	public void beforeProcess(ExcelReadContext<T> context) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void process(ExcelReadContext<T> context, List<T> list) {
		// TODO Auto-generated method stub
		dataList.addAll(list);
	}

//	@Override
//	public void onException(ExcelReadContext<T> context, ExcelReadException e) {
//		// TODO Auto-generated method stub
//		System.out.println(e.getMessage());
//	}

	@Override
	public void afterProcess(ExcelReadContext<T> context) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onException(ExcelReadContext<T> context, RuntimeException e) {
		System.out.println(e.getMessage());
		
	}

}
